package com.wanwu.channel.remote.allinpay.TLHttpUtils;

import org.apache.commons.lang3.ArrayUtils;

public class TLApplyStat {
    public final static String WAIT_VERIFY = "01";    // 待审核
    public final static String VERIFY_FAIL = "02";    // 审核不通过
    public final static String WAIT_PAY = "03";        // 待确认付款
    public final static String AMOUNT_ERR = "04";    // 到账金额不符
    public final static String PROCESSING = "05";    // 处理中
    public final static String SUCCESS = "06";        // 处理成功
    public final static String FAIL = "07";            // 处理失败
    public final static String SETTEX_FAIL = "08";    // 结汇失败
    public final static String WAIT_SETTEX = "09";    // 待结汇
    public final static String SETTEXING = "10";        // 结汇处理中
    public final static String CLOSED = "11";        // 交易已关闭
    public final static String WAIT_PAYEE = "12";    // 待收款
    public final static String WAIT_COMMIT = "13";    // 待提交
    public final static String FAIL_MODIFY = "14";    // 失败待修改
    public final static String MODIFY_REVERIFY = "15";    // 修改待审批
    public final static String WAIT_REVERIFY = "16";    // 待复核
    public final static String WAIT_REPAY = "17";    // 待重发
    public final static String WAIT_WITHDRAW = "18";    // 待提现
    public final static String DRAWING = "19";        // 提现中
    public final static String WAIT_REC = "20";        // 待收汇

    // TODO 需要跟资方确认 那些码需要重发 那些码需要修改重发
    private static String[] finishCode = {SUCCESS, FAIL, CLOSED, VERIFY_FAIL};
    // TODO 完善
    private static String[] middleCode = {PROCESSING};
    // TODO 完善
    private static String[] successCode = {SUCCESS};
    // TODO 完善
    private static String[] failCode = {FAIL};

    public static Boolean isFinish(String code) {
        return ArrayUtils.contains(finishCode, code);
    }

    public static Boolean isSuccess(String code) {
        return ArrayUtils.contains(successCode, code);
    }

    public static Boolean isFail(String code) {
        return ArrayUtils.contains(failCode, code);
    }

}
